package ch03;

import java.util.Scanner;

public class CoffeeStore {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("您要喝什么？");
        String type=input.next();
        if (type.equals("1")){
            AmericanCoffeeFactory factory=new AmericanCoffeeFactory();
            Coffee coffee = factory.createCoffee();
            System.out.println(coffee.getName());
        }else if (type.equals("2")){
            LatteCoffeeFactory factory=new LatteCoffeeFactory();
            Coffee coffee = factory.createCoffee();
            System.out.println(coffee.getName());
        }else{
            System.out.println("没有");
        }

    }
}
